//------------------------------------------------------------------------------------
#ifndef __CGAMEPLAYWIDGET_H__
#define __CGAMEPLAYWIDGET_H__
//------------------------------------------------------------------------------------
#include <QWidget>
#include "CSnake.h"
#include "CSouris.h"
#include "CMap.h"
#include "CControlPanel.h"
//------------------------------------------------------------------------------------
class CGamePlayWidget : public QWidget {
    Q_OBJECT
    public:
        CGamePlayWidget(QWidget *parent = 0);
        void next(void);
		void setTemps(int temps);
		void setNbVie(int nbVie);
    protected:
        virtual void paintEvent(QPaintEvent *event);
        virtual void keyPressEvent(QKeyEvent * event);
    private:
        CSnake *snake;
        CMap *map;
		CControlPanel *controlPanel;
		CSouris *souris;
		int idxImage;

        bool onSouris(void);
        void newSouris(void);
		int randInt(int low, int high);
        bool onMap(int index);
    signals:
        void mangeSouris(void);
        void die(void);
		void pause(void);
};
//------------------------------------------------------------------------------------
#endif // __CGAMEPLAYWIDGET_H__
//------------------------------------------------------------------------------------
